home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / opint102.5rc / D_MSG.PAS < prev    next >
Pascal/Delphi Source File  |  1988-12-04  |  3KB  |  119 lines

  1. Program DemoMessage;
  2.  
  3.   {***************************************************************************}
  4.   {*                                                                         *}
  5.   {* O p u s   I n t e r f a c e    V e r   1.02     Demo Program.           *}
  6.   {*                                                                         *}
  7.   {* Opus V 1.0x Interface for Turbo Pascal Ver 4.0                          *}
  8.   {*                                                                         *}
  9.   {*  These Structures,Procedures and Functions may help you to make OPUS    *}
  10.   {* utilities for to help other SysOps, Please read the Documentation.      *}
  11.   {*                                                                         *}
  12.   {*  Regards                                                                *}
  13.   {*    Per Holm                                                             *}
  14.   {*                                                                         *}
  15.   {*   FIDO: Per Holm - Asgaard BBS 2:230/22.0                               *}
  16.   {*   UUCP: perholm@daimi.DK                                                *}
  17.   {*                                                                         *}
  18.   {***************************************************************************}
  19.  
  20.  
  21. Uses
  22.   Dos,OPINT;
  23.  
  24. VAR
  25.   Msg: _Msg;
  26.  
  27. PROCEDURE Error;
  28.  
  29.   VAR
  30.     Err: Integer;
  31.  
  32.   BEGIN
  33.     Err:=OpIntERROR;
  34.     IF Err>0 THEN
  35.       BEGIN
  36.         Writeln('You Got Yourself an Error ',Err,' During OpInt Access');
  37.         Readln;
  38.       END;
  39.   END;
  40.  
  41. PROCEDURE Messages;
  42.  
  43.   Var
  44.     i: Integer;
  45.  
  46.   BEGIN
  47.     ReadMsg('1.MSG',Msg);
  48.     Error;
  49.     WriteMsg('2.msg',Msg);
  50.     Error;
  51.     WITH MSG DO
  52.       BEGIN
  53.         writeln('From .........: ',_From);
  54.         writeln('To ...........: ',_to);
  55.         writeln('Subject ......: ',_subj);
  56.         writeln('Date .........: ',_date);
  57.         writeln('Time .........: ',_Times);
  58.         writeln(_Dest,' ',_orig,' ',_cost);
  59.         readln;
  60.         FOR i:=1 to NumberOfLines DO
  61.           writeln(Lines[i]);
  62.       END;
  63.   END;
  64.  
  65. PROCEDURE SpeedTest;
  66.  
  67.   VAR
  68.     i: Integer;
  69.     DT, DT2: DateTime;
  70.  
  71.   BEGIN
  72.     writeln;
  73.     writeln('SPEED-TEST');
  74.     GetDateTime(DT);
  75.     FOR i:=1 TO 100 DO
  76.       BEGIN
  77.         ReadMsgHead('2.msg',Msg);
  78.         write(i:10,#13);
  79.       END;
  80.     GetDateTime(DT2);
  81.     Writeln(PackUnixDate(DT2)-PackUnixDate(DT),
  82.             ' Sec. to read 100 Msg headers,');
  83.     GetDateTime(DT);
  84.     FOR i:=1 TO 100 DO
  85.       BEGIN
  86.         WriteMsgHead('2.msg',Msg);
  87.         write(i:10,#13);
  88.       END;
  89.     GetDateTime(DT2);
  90.     Writeln(PackUnixDate(DT2)-PackUnixDate(DT),
  91.             ' Sec. to write 100 msg headers.');
  92.     GetDateTime(DT);
  93.     FOR i:=1 TO 100 DO
  94.       BEGIN
  95.         ReadMsg('1.msg',Msg);
  96.         write(i:10,#13);
  97.       END;
  98.     GetDateTime(DT2);
  99.     Writeln(PackUnixDate(DT2)-PackUnixDate(DT),
  100.             ' Sec. to Read 100 messages.');
  101.     GetDateTime(DT);
  102.     FOR i:=1 TO 100 DO
  103.       BEGIN
  104.         WriteMsg('2.msg',Msg);
  105.         write(i:10,#13);
  106.       END;
  107.     GetDateTime(DT2);
  108.     Writeln(PackUnixDate(DT2)-PackUnixDate(DT),
  109.             ' Sec. to Write 100 messages');
  110.     GetDateTime(DT);
  111.   END;
  112.  
  113. BEGIN
  114.   Messages;
  115.   readln;
  116.   SpeedTest;
  117.   ReadLn;
  118. END.
  119.